<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
// hard line break with BiDi
selection_test(
  '<div contenteditable dir="rtl">|\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">^\u05D0|\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-0 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0|\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0^\u05D1|\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-1 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1|\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1^\u05D2| abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-2 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2| abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2^ |abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-3 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 |abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 ^a|bc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-4 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 a|bc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 a^b|c \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-5 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 ab|c \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 ab^c| \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-6 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc| \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc^ |\u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-7 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc |\u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc ^\u05D3|\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-8 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3|\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3^\u05D4|\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-9 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4|\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4^\u05D5|<br>edf \u05D6\u05D7\u05D8 abrebg</div>',
  '20-10 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>|edf \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>^e|df \u05D6\u05D7\u05D8 abrebg</div>',
  '20-11 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>e|df \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>e^d|f \u05D6\u05D7\u05D8 abrebg</div>',
  '20-12 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>ed|f \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>ed^f| \u05D6\u05D7\u05D8 abrebg</div>',
  '20-13 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf| \u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf^ |\u05D6\u05D7\u05D8 abrebg</div>',
  '20-14 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf |\u05D6\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf ^\u05D6|\u05D7\u05D8 abrebg</div>',
  '20-15 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6|\u05D7\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6^\u05D7|\u05D8 abrebg</div>',
  '20-16 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7|\u05D8 abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7^\u05D8| abrebg</div>',
  '20-17 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8| abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8^ |abrebg</div>',
  '20-18 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 |abrebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 ^a|brebg</div>',
  '20-19 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 a|brebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 a^b|rebg</div>',
  '20-20 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 ab|rebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 ab^r|ebg</div>',
  '20-21 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abr|ebg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abr^e|bg</div>',
  '20-22 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abre|bg</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abre^b|g</div>',
  '20-23 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abreb|g</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abreb^g|</div>',
  '20-24 rtl forward character');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg|</div>',
  selection => selection.modify('extend', 'forward', 'character'),
  '<div contenteditable dir="rtl">\u05D0\u05D1\u05D2 abc \u05D3\u05D4\u05D5<br>edf \u05D6\u05D7\u05D8 abrebg|</div>',
  '20-25 rtl forward character');
</script>
